﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<skags.Models.ArticleCatViewModel>" %>
<% Html.RenderPartial("tinyMCE"); %>
    <% using (Html.BeginForm()) {%>
        <%: Html.ValidationSummary(true) %>
        <fieldset>
            <legend>Upplýsingar</legend>
            
            <div class="editor-label">
                Titill:
            </div>
            <div class="editor-field">
                <%: Html.TextBoxFor(model => model.Title) %>
                <%: Html.ValidationMessageFor(model => model.Title) %>
            </div>

            <div class="editor-label">
                Texti:
            </div>
            <div class="editor-field">
                <%: Html.ValidationMessageFor(model => model.Text) %>
                <%: Html.TextAreaFor(model => model.Text, new { cols = 40, rows = 30 })%>
                
            <div class="editor-label">
                Flokkur:
            </div>
            <div class="editor-field">
                <select name="CategoryID">
            <%
                foreach (var s in Model.Categories)
                {
                    %>
                    <option value="<%= s.ID %>"<%= s.ID == Model.CategoryID ? " selected" : "" %>><%: s.Title %></option>
                        <%
                }
            %>
            </select>
                <%: Html.ValidationMessageFor(model => model.CategoryID) %>
            </div>

            <div class="editor-label">
                <%: Html.CheckBoxFor(model => model.Approved) %>
                Samþykkt?
            </div>
            
            <p>
                <input type="submit" value="Vista" />
            </p>
        </fieldset>

    <% } %>